package com.qfedu.controller;

import com.qfedu.pojo.Registered;
import com.qfedu.service.IRegisteredService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Controller
public class RegisteredController {
    @Resource
    private IRegisteredService registeredService;
//    新增挂号
    @ResponseBody
    @PostMapping("/saveRegistered")
    public Registered saveRegistered(@RequestBody  Registered r){
        System.out.println(r);
        return registeredService.saveRegistered(r);

    }
    //    根据rid拿到全部进行编辑
    @GetMapping("/getRegisteredByRid")
   public Registered getRegisteredByRid(int rid){
        return registeredService.getRegisteredByRid(rid);
   }
//    修改挂号
   @PostMapping("/updateRegistered")
    public Registered updateRegistered(Registered r){
        return registeredService.updateRegistered(r);
   }

    }

